<template>
    <div class="courses-nav">
        <el-menu :default-active="activeIndex" class="el-menu-demo"  mode="horizontal" :router="true"  v-if="roleId == 'TEACHER' || roleId == 'UNIVERSITY_TEACHER' || roleId == 'MARKET_TEACHER' ">
            <el-menu-item index="/Teaching/Course/Theoretical/StudyFile" v-if="values == '本科' || values == ''">理论教学</el-menu-item>
            <el-menu-item index="/Teaching/Course/Theoretical/StudyFile" v-if="values == '专科'">任务引导</el-menu-item>
            <el-menu-item index="/Teaching/Course/Theoretical/ExperimentFile">实验教学</el-menu-item>
            <el-menu-item index="/Teaching/Course/Theoretical/StudyMaterials">备课材料</el-menu-item>
            <!-- <el-menu-item index="/Teaching/Course/Theoretical/StudyVideo"  >理论课学习视频</el-menu-item> -->
            <!-- <el-menu-item index="/Teaching/Course/Theoretical/ExpeimentStudyVideo">实验课学习视频</el-menu-item> -->
            <el-menu-item index="/Teaching/Course/Theoretical/StudyResourse" >学习资源</el-menu-item>
            <el-menu-item index="/Teaching/Course/Theoretical/PracticeItemBank">随堂练习</el-menu-item>
        </el-menu>
          <el-menu :default-active="activeIndex" class="el-menu-demo"  mode="horizontal" :router="true"  v-if="roleId == 'SUPER_ADMIN' || roleId == 'INTERNET_ADMIN' ">
            <!-- <el-menu-item index="/Admin/Theoretical/StudyFile" >理论教学</el-menu-item> -->
            <el-menu-item index="/Admin/Theoretical/StudyFile" v-if="values == '本科' || values == ''">理论教学</el-menu-item>
            <el-menu-item index="/Admin/Theoretical/StudyFile" v-if="values == '专科'">任务引导</el-menu-item>
            <el-menu-item index="/Admin/Theoretical/ExperimentFile">实验教学</el-menu-item>
            <el-menu-item index="/Admin/Theoretical/StudyMaterials">备课材料</el-menu-item>
            <!-- <el-menu-item index="/Admin/Theoretical/StudyVideo">理论课学习视频</el-menu-item> -->
            <!-- <el-menu-item index="/Admin/Theoretical/ExpeimentStudyVideo">实验课学习视频</el-menu-item> -->
            <el-menu-item index="/Admin/Theoretical/StudyResourse" >学习资源</el-menu-item>
            <el-menu-item index="/Admin/Theoretical/PracticeItemBank">随堂练习</el-menu-item>
        </el-menu>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                activeIndex: '',
                 //角色
                roleId:'',
                //本科还是专科
                values:''
            }
        },
        created() {
            this.roleId=this.$store.state.user.roles[0]
            //获取是专科还是本科
            this.values = this.$localstorage.getLocalStorage('isvalve')
            console.log( this.values,1111)
            this.fetchDate()
        },
        methods: {
            fetchDate() {
                let self = this
                var cur_path = self.$route.meta.navActive; //获取当前路由
                self.activeIndex = cur_path
                console.log( self.activeIndex,989)
            },
            handleSelect(key, keyPath) {
                console.log(key, keyPath)
            }
        },
        watch: {
            "$route": "fetchDate"
		}
    }
</script>
<style lang="scss" scoped>
    .courses-nav{
        .el-menu-demo{
            .el-menu-item{
                &:hover{
                     color:#1277eb
                }
            }
        }
    }
</style>
